<%@ page import="java.sql.*" errorPage="" %>   
    <% //Grab the username and emp_id from the session
       //String uname=(String)session.getAttribute("userName");
       //String emp_id=(String)session.getAttribute("emp_id");
       //int ei=Integer.parseInt(emp_id);
       String uname="subodh";
       int ei=2;
       %>
<h1>Hello
 <span class="green"> 

</span></h1>
        <h1>It's <span class="green"><%= new java.util.Date() %></span></h1>
	<form action="uploadprocess.jsp" >		
	<p>				
	<label>Upload your files here</label><br /><br />
<P><label>Projects Allocated to You:</label>
<SELECT NAME="tasks_allocated" >
    <%
        String query="select distinct(project.name) from project, task ,task_division where task_division.emp_id='2'"+" and task.task_id=task_division.task_id and task.project_id=project.project_id";
        Connection db_conn = null;
        Statement statement = null;
        PreparedStatement pstmt;
        ResultSet rs;
        try{
             Class.forName("com.mysql.jdbc.Driver");
             String url= "jdbc:mysql://localhost:3306/project_management";
             db_conn = DriverManager.getConnection( url,"root", "" );
             statement = db_conn.createStatement();  
             rs=statement.executeQuery(query);
             while (rs.next()) { // parse the results
                 String pname=rs.getString("project.name");
                out.println("<OPTION value="+pname+">"+pname+"</OPTION>");
			
            }
        db_conn.close();
        }
        catch(SQLException e){
        e.printStackTrace();
           out.println("sql not found");
           out.println(e);
           }
        catch(ClassNotFoundException e){
        e.printStackTrace();
        out.println(e);
        }
    %>

    
    
    
    
    
    
    </SELECT>
</P>
<p>
	<label>File to be uploaded</label>
    <input name="file_upload" type="file"  />
	
</p>
		
	</p>		
<input type="submit" value="Upload">
     </form>				
	<br />	<br />
    <label>Upload Successful!! Thank you</label>